<!-- 地图相关弹窗 -->
<script setup>
import { toRefs } from 'vue';

const props = defineProps({
  visible: Boolean,
  width: String,
  height: String,
});
const { visible, width, height } = toRefs(props);
const emit = defineEmits(['update:visible']);

const close = () => {
  emit('update:visible', false);
};
</script>
<template>
  <div v-show="visible" class="modal-mask" :style="{ '--width': width, '--height': height }">
    <div class="modal-container">
      <div class="modal-header">
        <slot name="header"> 默认标题 </slot>
      </div>
      <div class="modal-close">
        <slot name="close">
          <div title="关闭" @click="close">X</div>
        </slot>
      </div>
      <div class="modal-body">
        <slot name="body"> 默认内容 </slot>
      </div>
      <div class="modal-footer">
        <slot name="footer">
          <div class="btn_1">关闭</div>
          <div class="btn_2">确认</div>
        </slot>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.5);
}
.modal-container {
  position: relative;
  box-sizing: border-box;
  width: var(--width);
  height: var(--height);
  padding: 20px;
  background: url(../assets/images/icon/弹窗背景框.png) no-repeat;
  background-size: 100% 100%;
  border-radius: 5px;
  .modal-header {
    margin-left: 38px;
    color: #ffffff;
    font-weight: 600;
    font-size: 22px;
    font-family: PangMenZhengDao;
    letter-spacing: 2px;
    text-shadow: 0px 2px 1px rgba(11, 26, 53, 0.4);
  }

  .modal-body {
    padding: 70px 30px 42px 23px;
    font-size: 16px;

    :deep(.el-radio__label) {
      font-size: 16px;
    }
    :deep(.el-input) {
      width: 458px;
      height: 40px;
    }
    :deep(.el-input__wrapper) {
      padding: 0px 0 0 5px;
      background: none;
      box-shadow: 0 0 0 0.0625rem #657faa inset;
    }
    :deep(.el-input-number) {
      width: 100%;
      height: 100%;
    }
    :deep(.el-input-number.is-controls-right .el-input-number__decrease) {
      display: none;
    }
    :deep(.el-input-number.is-controls-right .el-input-number__increase) {
      display: none;
    }
    :deep(.el-input-number .el-input__inner) {
      color: #d0f2ff;
      text-align: left;
    }
    :deep(.el-input-number.is-controls-right .el-input__wrapper) {
      padding: 0px 0 0 5px;
    }
    :deep(.el-form-item__label) {
      width: 200px;
      color: #fff;
      font-size: 16px;
    }
  }

  .modal-close {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 20px;
    cursor: pointer;
  }

  .modal-footer {
    position: absolute;
    right: 35px;
    bottom: 50px;
    display: flex;
    div {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 120px !important;
      height: 44px;
      margin-right: 12px;
      font-size: 16px;
      border-radius: 4px;
      cursor: pointer;
    }

    .btn_1 {
      color: #ff8787;
      border: 1px solid #ff8787 !important;
    }

    .btn_2 {
      color: #ffffff;
      background-color: #669eff;
    }
  }
}
</style>
